package loginSys.controller;

import loginSys.untill.HttpDataUntill;
import loginSys.untill.MessageUntill;
import loginSys.untill.YmlConfig;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by zhoumeineng on 2018/1/30.
 */
@RestController
@RequestMapping(value = "/loginSys/${app.version}",method = RequestMethod.POST)
public class LoginController {


    @Autowired
    YmlConfig ymlConfig;

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("/userInformation")
    public void userInformation(HttpServletRequest req, HttpServletResponse rsp) {
        JSONObject result = HttpDataUntill.httpRspSet(req,rsp);
        JSONObject jsonObject = HttpDataUntill.PostReqsuet(result,ymlConfig.getRegistgetUserInfo(),restTemplate);
        MessageUntill.ResboneOutPut(rsp,jsonObject);
    }

}
